package com.pany.exceptions;

/**
 * 业务处理异常
 * 
 * @author 曾杰
 * @since 2012-10-30/V0.1
 */
public class ServiceException extends RuntimeException
{
    private int code;

    private Object[] errorMsgArgs; 

    public ServiceException(int code, Object... errorMsgArgs)
    {
        this.code = code;
        this.errorMsgArgs = errorMsgArgs;
    }

    public ServiceException(String message, Throwable cause, int code,
            Object... errorMsgArgs)
    {
        super(message, cause);
        this.code = code;
        this.errorMsgArgs = errorMsgArgs;
    }

    public ServiceException(String message, int code, Object... errorMsgArgs)
    {
        super(message);
        this.code = code;
        this.errorMsgArgs = errorMsgArgs;
    }

    public ServiceException(Throwable cause, int code, Object... errorMsgArgs)
    {
        super(cause);
        this.code = code;
        this.errorMsgArgs = errorMsgArgs;
    }

    public int getCode()
    {
        return code;
    }

    public Object[] getErrorMsgArgs()
    {
        return errorMsgArgs;
    }

}
